package com.usian.admin.controller;

import com.usian.admin.service.impl.SensitiveServiceImpl;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class SensitiveController {
    @Autowired
    private SensitiveServiceImpl service;

    @PostMapping("/list")
    public ResponseResult list(@RequestBody  SensitiveDto dto) {
        return service.list(dto);
    }

    @PostMapping("/save")
    public ResponseResult saves(@RequestBody AdSensitive adSensitive) {
        return service.saves(adSensitive);
    }

    @PostMapping("/update")
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return service.update(adSensitive);
    }

    @DeleteMapping("del/{id}")
    public ResponseResult deleteById(@PathVariable Integer id) {
        return service.deleteById(id);
    }
}
